export function stringPolyFill() {
    String.prototype.trim = function (char, type) {
        if (char) {
            if (type === 'left') {
                return this.replace(new RegExp('^\\'+char+'+', 'g'), '');
            } else if (type === 'right') {
                return this.replace(new RegExp('\\'+char+'+$', 'g'), '');
            }
            return this.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), '');
        }
        return this.replace(/^\s+|\s+$/g, '');
    };
    if(typeof String.prototype.insert !== 'function') {
        String.prototype.insert = function (index, string) {
            if (index> 0)
                return this.substring(0, index) + string + this.substring(index, this.length);
            else
                return string + this;
        };
    }
}